/**
 * <p>所有的快递单类</p>
 */
package com.taobao.wolfwolf.taobao;

/**
 * @author qinanhg
 * 创建日期: 2012-3-13 上午1:02:27
 */
public class ExpressCollect {
	
	/**
	 * <p>按快递公司代码来获取快递类</p>
	 * @param expressName
	 * @return
	 */
	public static Express getExpressByCode(String expressName) {
		if(expressName.equals("SF")) {
			return addSF();
		} else if(expressName.equals("STO")) {
			return addSTO();
		} else if(expressName.equals("YTO")) {
			return addYTO();
		} else if(expressName.equals("EMS")) {
			return addEMS();
		}
		
		return null;
	}
	
	/**
	 * <p>圆通</p>
	 */
	private static Express addYTO() {
		Express yto = new Express();
		yto.setCode_name("YTO");
		yto.setName("圆通速递");

		ExpressFieldPosition fieldPosition = new ExpressFieldPosition();
		
		// 快递单大小
		fieldPosition.setWidth(231);
		fieldPosition.setHeight(126);
		
		// 寄件人方
		fieldPosition.setSender_name("39:28");
		fieldPosition.setSource_city("80:28");
		fieldPosition.setSeller_company_name("45:43");
		fieldPosition.setSender_address_1("35:48");
		fieldPosition.setSender_address_2("18:55");
		fieldPosition.setSeller_phone("45:62");
		fieldPosition.setSell_goods("35:79");
		fieldPosition.setSeller_sign("50:99");
		fieldPosition.setYear("20:107");
		fieldPosition.setMonth("33:107");
		fieldPosition.setDay("43:107");
		
		// 收件人方
		fieldPosition.setReceiver_name("135:32");
		fieldPosition.setDestination_city("172:32");
		fieldPosition.setBuyer_company_name("140:39");
		fieldPosition.setReceiver_address1("127:48:82");
		fieldPosition.setReceiver_address2("113:57:95");
		fieldPosition.setBuyer_phone("140:62");
		
		yto.setFieldPosition(fieldPosition);
		
		return yto;
	}
	
	/**
	 * <p>EMS</p>
	 */
	private static Express addEMS() {
		Express ems = new Express();
		ems.setCode_name("EMS");
		ems.setName("EMS");
		
		ExpressFieldPosition fieldPosition = new ExpressFieldPosition();
		
		// 快递单大小
		fieldPosition.setWidth(231);
		fieldPosition.setHeight(126);
		
		// 寄件人方
		fieldPosition.setSource_city("37:29");
		fieldPosition.setYear("72:28");
		fieldPosition.setMonth("83:28");
		fieldPosition.setDay("92:28");
		fieldPosition.setSender_name("40:37");
		fieldPosition.setSeller_phone("83:36");
		
		fieldPosition.setSeller_company_name("55:44");
		fieldPosition.setSender_address_1("37:57");
		fieldPosition.setSender_address_2("22:68");
		fieldPosition.setSell_goods("43:85");
		fieldPosition.setSeller_sign("55:107");
		
		// 收件人方
		fieldPosition.setReceiver_name("133:37");
		fieldPosition.setBuyer_phone("176:36");
		fieldPosition.setBuyer_company_name("145:44");
		fieldPosition.setReceiver_address1("115:57:95");
		fieldPosition.setReceiver_address2("113:63:95");
		fieldPosition.setDestination_city("130:68");
		
		ems.setFieldPosition(fieldPosition);
		
		return ems;
	}

	
	/**
	 * <p>顺丰</p>
	 */
	private static Express addSF() {
		Express sf = new Express();
		sf.setCode_name("SF");
		sf.setName("顺丰速运");
		
		ExpressFieldPosition fieldPosition = new ExpressFieldPosition();
		
		// 快递单大小
		fieldPosition.setWidth(217);
		fieldPosition.setHeight(140);
		
		// 寄件人方
		fieldPosition.setSeller_company_name("37:42");
		fieldPosition.setSender_name("80:42");
		fieldPosition.setSender_address_1("28:48:71");
		fieldPosition.setSender_address_2("17:56:81");
		fieldPosition.setSeller_phone("47:65");
		fieldPosition.setSell_goods("46:119");
		fieldPosition.setMonth("159:96");
		fieldPosition.setDay("171:96");
		
		// 收件人方
		fieldPosition.setBuyer_company_name("35:82");
		fieldPosition.setReceiver_name("80:82");
		fieldPosition.setReceiver_address1("28:89:71");
		fieldPosition.setReceiver_address2("17:97:81");
		fieldPosition.setBuyer_phone("45:105");
		
		sf.setFieldPosition(fieldPosition);
		
		return sf;
	}
	
	/**
	 * <p>申通</p>
	 */
	private static Express addSTO() {
		Express sto = new Express();
		sto.setCode_name("STO");
		sto.setName("申通E物流");

		ExpressFieldPosition fieldPosition = new ExpressFieldPosition();
		
		// 快递单大小
		fieldPosition.setWidth(231);
		fieldPosition.setHeight(126);
		
		// 寄件人方
		fieldPosition.setSender_name("38:35");
		fieldPosition.setSource_city("80:35");
		fieldPosition.setSeller_company_name("45:43");
		fieldPosition.setSender_address_1("35:53");
		fieldPosition.setSender_address_2("18:61");
		fieldPosition.setSeller_phone("45:69");
		fieldPosition.setSell_goods("32:97");
		fieldPosition.setGoods_num("90:97");
		fieldPosition.setSeller_sign("50:104");
		fieldPosition.setYear("22:108");
		fieldPosition.setMonth("33:108");
		fieldPosition.setDay("42:108");
		
		// 收件人方
		fieldPosition.setReceiver_name("135:35");
		fieldPosition.setDestination_city("176:35");
		fieldPosition.setBuyer_company_name("135:43");
		fieldPosition.setReceiver_address1("125:53:80");
		fieldPosition.setReceiver_address2("115:61:93");
		fieldPosition.setBuyer_phone("137:70");
		
		sto.setFieldPosition(fieldPosition);
		
		return sto;
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
	}

}
